IF Contime-EntTime>30 AND Veru$="000" THEN okp=0:a$=r$+"Time limit exceeded."+r$:GOSUB Modem:RETURN
IF Contime-EntTime>45 AND Veru$="007" THEN okp=0:a$=r$+"Time limit exceeded."+r$:GOSUB Modem:RETURN
okp=1:RETURN
Voting:
IF okp<>1 THEN RETURN
GOSUB CheckConTime:IF okp<>1 THEN RETURN
CLOSE#2:OPEN "R", #2, "df1:USER",120
FIELD #2, 1 AS check$,9 AS N1$,15 AS N2$,10 AS Co$,15 AS Adr$,10 AS CI$,10 AS STA$,3 AS AG$,9 AS PAS$,3 AS B1$,3 AS B2$,3 AS B3$,3 AS B4$,3 AS B5$,3 AS B6$,3 AS B7$,3 AS B8$,3 AS B9$,1 AS EM1$,1 AS EM2$,1 AS EM3$,1 AS EM4$,1 AS EM5$,3 AS Valu$
FIELD #2, 117 AS dump$,1 AS VTE1$,1 AS VTE2$,1 AS VTE3$
GET#2,UserID
CLOSE#3:OPEN "I",#3,"df1:Votes/QuestNo"
LINE INPUT#3,QNo$:CLOSE#3:QNo=VAL(QNo$)
MoreVoting:
IF okp<>1 THEN RETURN
GOSUB CheckConTime:IF okp<>1 THEN RETURN
a$=r$+"Voting (? for Menu):":GOSUB A1:MenS$=UCASE$(LEFT$(t$,1)):meni=VAL(MenS$)
IF meni>=1 AND meni<=QNo THEN zl$="VmT"+MenS$:GOTO Questionaire
IF MenS$="?" THEN file$="df1:Votes/VoteMenu":GOSUB SeqRead:GOTO MoreVoting
IF MenS$="R" THEN Results
IF MenS$="X" THEN ExitVoting
a$=r$+"No Such Command":GOSUB Modem:GOTO MoreVoting
Questionaire:
IF Altes$(meni)="1" THEN a$=r$+"Sorry, You've already voted.":GOSUB Modem:GOTO MoreVoting
file$=MenS$+".":j=0
CLOSE#3:OPEN "I",#3,"df1:Votes/"+file$
ERASE TBL$:DIM TBL$(45)
WHILE NOT EOF(3)
j=j+1
LINE INPUT#3,TBL$(j)
Assi(j)=VAL(TBL$(j))
WEND
CLOSE#3:OPEN "I",#3,"df1:Votes/"+zl$
ERASE TBL$:DIM TBL$(45):j=0
WHILE NOT EOF(3)
j=j+1
LINE INPUT#3,TBL$(j)
WEND
CLOSE#3:l=0:v=0:Mensl=0:trendy=j
WHILE l<trendy
l=l+1:v=v+1
IF v<>4 THEN a$=TBL$(l)+r$:GOSUB Modem
IF v=4 THEN a$=TBL$(l):GOSUB A1:MenS$=LEFT$(t$,1):Mensl=VAL(MenS$):IF Mensl<1 OR Mensl>4 THEN l=l-1:v=v-1
IF v=4 AND MenS$="1" THEN Assi(l-3)=Assi(l-3)+1
IF v=4 AND MenS$="2" THEN Assi(l-2)=Assi(l-2)+1
IF v=4 AND MenS$="3" THEN Assi(l-1)=Assi(l-1)+1
IF v=4 AND MenS$="4" THEN Assi(l)=Assi(l)+1
IF v=4 THEN a$=r$:GOSUB Modem:v=0
WEND
CLOSE#3:j=0:OPEN "O",#3,"df1:Votes/"+file$
WHILE j<trendy
j=j+1
a$=STR$(Assi(j)):a$=RIGHT$(a$,LEN(a$)-1)+r$
PRINT#3,a$
a$=""
WEND
CLOSE#3:Altes$(meni)="1":GOTO MoreVoting
Results:
IF okp<>1 THEN RETURN
GOSUB CheckConTime:IF okp<>1 THEN RETURN
file$="df1:Votes/ResultsMenu":GOSUB SeqRead
a$=r$+"Results for which Question:":GOSUB A1:MenS$=LEFT$(t$,1):meni=VAL(MenS$)
IF meni>=1 AND meni<=QNo THEN zl$="VmT"+MenS$:GOTO MoreResults
GOTO MoreVoting
MoreResults:
file$=MenS$+".":j=0
CLOSE#3:OPEN "I",#3,"df1:Votes/"+file$
ERASE TBL$:DIM TBL$(45)
WHILE NOT EOF(3)
j=j+1
LINE INPUT#3,TBL$(j)
WEND
CLOSE#3:j=0:OPEN "I",#3,"df1:Votes/"+zl$
ERASE ABCS$:DIM ABCS$(185)
WHILE NOT EOF(3)
j=j+1
LINE INPUT#3,ABCS$(j)
WEND
trendy=j:CLOSE#3:l=0:v=0:k=0
WHILE l<trendy
l=l+1:v=v+1
a$=ABCS$(l):GOSUB Modem:a$=""
IF v=4 THEN a$=r$:GOSUB Modem:a$="":k=k+1:a$="1.) "+TBL$(k):GOSUB Modem:a$=""
IF v=4 THEN k=k+1:a$="2.) "+TBL$(k):GOSUB Modem:a$=""
IF v=4 THEN k=k+1:a$="3.) "+TBL$(k):GOSUB Modem:a$=""
IF v=4 THEN k=k+1:a$="4.) "+TBL$(k):GOSUB Modem:a$=""
IF v=4 THEN a$=r$:GOSUB Modem:v=0
WEND
GOTO MoreVoting
ExitVoting:
LSET VTE1$=Altes$(1)
LSET VTE2$=Altes$(2)
LSET VTE3$=Altes$(3)
PUT#2,UserID
CLOSE#2
RETURN
Teflon:
IF teetse=1 THEN a$=r$+"Sorry, not allowed!":GOSUB Modem:okp=1:GOTO Menus